package com.inossem.warehousestorage_inossem.activity.allocation.out_storage;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.inossem.utils.listener.NoDoubleClickListener;
import com.inossem.warehousestorage_inossem.R;
import com.inossem.warehousestorage_inossem.activity.base.BaseActivity;
import com.inossem.warehousestorage_inossem.utils.ActivityUtils;
import com.inossem.warehousestorage_inossem.utils.BaseInteface;

/**
 * 有无调拨单
 *
 * @author 詹建宇
 * @time on 2018/3/29 9:46
 * @email jianyu.zhan@inossem.com
 */
public class AllocationOutIsHaveDocumentActivity extends BaseActivity implements BaseInteface, View.OnClickListener {

    private TextView title;
    private RelativeLayout nDocumentLayout, yDocumentLayout;

    @Override
    protected void onCreateImpl(Bundle savedInstanceState) {
        super.onCreateImpl(savedInstanceState);
        setContentView(R.layout.cy_activity_out_storage_allocating_ishavedocument);

        initView(this);
        initData(this);
    }

    @Override
    public void initView(Activity activity) {
        title = (TextView) activity.findViewById(R.id.headerTitle);
        nDocumentLayout = (RelativeLayout) activity.findViewById(R.id.nDocumentLayout);
        yDocumentLayout = (RelativeLayout) activity.findViewById(R.id.yDocumentLayout);

        nDocumentLayout.setOnClickListener(this);
        yDocumentLayout.setOnClickListener(this);
    }

    @Override
    public void initData(Activity activity) {
        title.setText(activity.getResources().getString(R.string.cy_activity_out_storage_allocating_ishave_document));
        ActivityUtils.initBackAndFunction(activity, R.string.activity_receive_result_back, new NoDoubleClickListener() {
            @Override
            public void onNoDoubleClick(View v) {
                finish();
            }
        });
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.nDocumentLayout://无
                startActivity(new Intent(this,AllocationOutCreatDocumentActivity.class));
                break;
            case R.id.yDocumentLayout://有
                startActivity(new Intent(this,AllocationOutDocumentsActivity.class));
                break;
        }
    }
}
